package Application.AppStates;
import org.omg.CORBA.Current;

import Interfaces.IUpdatableComponent;

/**
 * Class Handling application states!
 * @author drahomir.karchnak
 *
 */

public class AppStatesHandler{
	public static final long STATE_CHANGE_DELAY		=	5000;
	public static final AppStates FIRST_APPSTATE	=	AppStates.none;
	
	private AppStates currentAppStates;
	
	public AppStatesHandler(){
		this.currentAppStates = FIRST_APPSTATE;
	}
	
	/**
	 * Return current AppState
	 * @return
	 */
	
	public AppStates getCurrentAppStates() {
		return currentAppStates;
	}
	
	/**
	 * Just switch to following AppState
	 * (looping all AppStates)
	 */
	
	public void nextAppState(){
		switch(currentAppStates){
			case diningList:
				currentAppStates = AppStates.none;
				System.out.println("[i] AppState has been change to " + currentAppStates + " state!");
				break;
				
			case none:
				currentAppStates = AppStates.schedule;
				System.out.println("[i] AppState has been change to " + currentAppStates + " state!");
				break;
				
			case schedule:
				currentAppStates = AppStates.diningList;
				System.out.println("[i] AppState has been change to " + currentAppStates + " state!");
				break;
				
			default:
				currentAppStates = FIRST_APPSTATE;
				System.out.println("[i] AppState has been change to " + currentAppStates + " state!");
				break;
		}
	}
}
